import request from '../utils/request';
import {service_host} from './config';

export async function addTestReport(params) {
  return request(`${service_host}/testreport/add`, {
      method: 'POST',
      body: params
  });
}

export async function getReportList() {
  return request(`${service_host}/testreport/getList`, {
      method: 'GET'
  });
}

export async function editBasicReport(params){
  return request(`${service_host}/testreport/editBasic`,{
      method : 'POST',
      body:params
  })
}

export async function editTextReport(params){
  return request(`${service_host}/testreport/editText`,{
      method : 'POST',
      body:params
  })
}

export async function queryActiveReport(params){
  return request(`${service_host}/testreport/activeReport`,{
      method : 'POST',
      body:{id:params}
  })
}

export async function deleteTestReport(params){
  return request(`${service_host}/testreport/deleteReport`,{
      method : 'POST',
      body:params
  })
}

export async function setTestData(params){
  return request(`${service_host}/testreport/setTestData`,{
      method : 'POST',
      body:params
  })
}

export async function releaseReport(params){
  return request(`${service_host}/testreport/ReleaseReport`,{
      method : 'POST',
      body:params
  })
}

export async function setTestStatus(params){
  return request(`${service_host}/testreport/updateTestStatus`,{
      method : 'POST',
      body:{name:params.name,
            version:params.version }
  })
}

export async function queryBasicData(params){
  return request(`${service_host}/testreport/getBasicData`,{
      method : 'GET',
  })
}

export async function deleteBasicData (params){
  return request(`${service_host}/testreport/deleteBasicData`,{
      method : 'POST',
      body:{deleteData:params}
  })
}

export async function addBasicData (params){
  return request(`${service_host}/testreport/addBasicData`,{
      method : 'POST',
      body:{newData:params}
  })
}